<?php
namespace RestClient;

class RestException extends \Exception
{
    public $statusCode;
    public $errorCode;
    public $message;

    public function __construct($statusCode, $message, $errorCode)
    {
        parent::__construct($message);
        $this->message = $message;
        $this->errorCode = $errorCode;
        $this->statusCode = $statusCode;
    }

    public function getErrorCode()
    {
        return $this->getErrorCode;
    }

    public function getErrorMessage()
    {
        return $this->message;
    }

    public function getStatusCode()
    {
        return $this->statusCode;
    }

    public function __toString()
    {
        return __CLASS__ . ":[{$this->code}]{$this->message}";
    }

}
